Learning Objectives

After completing this lesson, you’ll be able to:

Resources

Introduction

Many FME transformers have a Generate List checkbox under the Attribute Accumulation section of their parameters dialog. For example:Generate List checkbox

For query transformers that can return multiple results, like the PointOnAreaOverlayer, these parameters can be used to generate a list to store the results.

In this scenario, we want to create park polygons that have attributes telling us what trees exist in each park. To do this, we will merge tree points with park polygons using the PointOnAreaOverlayer. However, it isn't enough to simply copy attributes from each tree to their respective park polygons, because what if there is more than one tree per park? List attributes are perfect for this scenario: if more than one tree falls within the same park polygon, we can use a list attribute to store information for all trees. The PointOnAreaOverlayer allows us to generate a list that stores the values for all points overlaid on the area.

The workspace will:

1) Open FME Workbench

Open the starting workspace in FME Workbench (2021.0 or later). The workspace is set up so you can inspect the source data on the first run.

2) Run the Workspace and Inspect the Data

Run the workspace and view the data in Visual Preview or the Data Inspector. Note how some parks contain multiple point features. For example, China Creek Park North contains two coincident trees, as shown in the Table View:

Viewing the two trees of China Creek Park in Visual Preview

For the next steps, we won’t need to inspect the source data anymore, so right-click the pink bookmark titled Initial Data Inspection and click Disable All Objects in Bookmark. Right-click the data inspector output called Result and enable it.

3) Set PointOnAreaOverlayer Parameters: Merge Attributes

Double-click the PointOnAreaOverlayer to open its parameters. By default, the checkboxes under Attribute Accumulation are unchecked, which means the area and point attributes are not being merged and no list attributes are being created. Check Merge Attributes.

Merge Attributes, don't generate lists

Click OK to close the parameters.

4) Run the Workspace

Run the workspace and inspect China Creek Park North again, which contains two tree points. The PointOnAreaOverlayer adds an _overlaps attribute that counts the number of points in each area. In the Feature Information pane, we can see that it has two overlaps, but attributes from only one of the tree species have been added:

Attributes from one tree species
This is the result of merging the incoming features. To include all trees in a given park, we will need to create a list.

5) Set PointOnAreaOverlayer Parameters: Generate List

Open the PointOnAreaOverlayer parameters and uncheck Merge Attributes. Instead, check Generate List on Output ‘Area’. Name the list _trees and use Selected Attributes to select the attributes Common Name, Diameter, Height, Species, and TreeID.
Don't Merge Attributes, Generate List on Area

Click OK to close the parameters.

6) Run the Workspace

Run the workspace and inspect China Creek Park North again. The Feature Information pane shows a list attribute, _trees{}, which contains information from both tree points in the park:
Tree list

We successfully used the PointOnAreaOverlayer to create a list called _trees{}, which stores the values of multiple tree points that fall within each park polygon. Note how each numbered list element contains the same set of attributes: CommonNameDiameter, etc.

Next Steps

The next step is to process and analyze the data. For example, a TestFilter can be used to filter out parks that contain no tree points, and then list manipulation transformers can be used for tasks like the following:
 

Operation Transformer
Count the number of trees in each park ListElementCounter
Find the maximum tree diameter ListSorter & ListIndexer
Find the count of each species ListHistogrammer
Create a list of species ListConcatentaor
Find which parks have an Oak tree ListSearcher
Create a table of park trees with the park name ListExploder
Find the average tree height in a park ListSummer
Find the minimum/maximum of tree diameters ListRangeExtractor

You can learn to use these transformers in the next lesson.